<script>
export default {
  name: "detail",
  data() {
    return {
      image: '',
      detail: {
        color: {

        }
      }
    }
  },
  onLoad({ id }) {
    this.$api.diagnosisDetail(id).then(res => {
      this.detail = {
        ...res,
        image: this.$baseUrl + res.image
      }
    })
  },
  methods: {
  }
}
</script>

<template>
  <view class="detail">
    <canvas canvas-id="mainColorCanvas" style="width: 1px; height: 1px; position: absolute; top: -10000px; left: -10000px;"></canvas>

    <view class="detail-content">
      <view class="detail-content-title">诊断图片</view>
      <view class="detail-content-img">
        <image :src="detail.image" mode="aspectFill" style="width: 100%;"></image>
      </view>
    </view>
    <view class="detail-header">
      <view class="detail-header-title">诊断详情</view>
      <view class="detail-header-time">{{ detail.create_time}}</view>
    </view>
    <div style="padding: 0 20rpx">
      <u-parse :html="detail.color.content"></u-parse>

    </div>
  </view>
</template>

<style scoped lang="scss">
.detail {
  .detail-header {
    padding: 20rpx;
    background-color: #fff;
    display: flex;
    align-items: center;justify-content: space-between;
    .detail-header-title {
      font-size: 32rpx;
      color: #333;
    }
    .detail-header-time {
      font-size: 24rpx;
      color: #999;
      margin-top: 10rpx;
    }
  }
  .detail-content {
    padding: 20rpx;
    background-color: #fff;
    margin-top: 20rpx;

    .detail-content-title {
      font-size: 28rpx;
      color: #333;
    }

    .detail-content-text {
      font-size: 28rpx;
      color: #666;
      margin-top: 10rpx;
    }

    .detail-content-img {
      margin-top: 20rpx;

      .image {
        width: 100%;
      }
    }
  }
}
</style>